home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
eflibpt4.zip
/
DEMO
/
STREAMS
/
TEXTSTRM.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1996-08-11
|
947b
|
28 lines
{ Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
Demonstration; text files implemented as streams
EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED. }
uses EFLIBIO;
const BufferSize = 1000; { Buffer size for the data stream }
var TextFile : FileStreamObjectType; Text : string;
begin
{ Initialize buffered file stream }
TextFile.Initialize ('..\hamlet.txt', BufferSize);
{ Filename } { Buffer size in bytes }
while not TextFile.IsEnd do begin
{ Read text line from the stream }
TextFile.ReadString (Text); { All text lines end with EOL }
WriteLn (Text); { Display line }
end;
TextFile.Intercept; { Intercept stream }
end.